package com.kaoshi.servefw.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kaoshi.servefw.domain.Stables;
import com.kaoshi.servefw.service.StablesService;
import com.kaoshi.servefw.mapper.StablesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author Lenovo
 * @description 针对表【stables】的数据库操作Service实现
 * @createDate 2024-10-28 19:37:31
 */
@Service
public class StablesServiceImpl extends ServiceImpl<StablesMapper, Stables>
        implements StablesService{

    @Autowired
    private StablesMapper stablesMapper;
    @Override
    public Page findPage(Integer pageNum, Integer pageSize, Stables stables) {
        Page<Stables> stablesPage = new Page<>(pageNum,pageSize);
        List<Stables> stablesList = stablesMapper.findPage(stablesPage,stables);
        stablesPage.setRecords(stablesList);
        return stablesPage;
    }

    @Override
    public Stables findById(Integer id) {
        return stablesMapper.findById(id);
    }

    @Override
    public Page findPageSr(Integer pageNum, Integer pageSize, Stables stables) {
        Page<Stables> stablesPage = new Page<>(pageNum, pageSize);
        List<Stables> stablesList =  stablesMapper.findPageSr(stablesPage, stables);
        stablesPage.setRecords(stablesList);
        return stablesPage;
    }




}




